Deploying Party Microservice on Azure

This section explains how to deploy the Party Microservice on the Azure cloud. To do so, you need to perform the following tasks:

Deployment Artefacts

Party Microservices for Azure deployment is available as a single-release bundle with respect to databases as ms-party-package-azure-mongo<release_number>.zip and ms-party-package-azure-postgresql<release_number>.zip.

Deploying Party Microservice on Azure

For MongoDB

Script Files and Folder Structure

  • Azure Script files:
    • install.sh/install.bat: This script deploys the Party Microservice in the Standalone mode.
    • destroy.sh/destroy.bat: This script undeploys the Microservice and delete the Azure services from the Azure environment.
  • Folder structure for the ms-party-package-azure-<release_number>.zip file is as follows.

    Pom-azure-deploy.xml file deploys the Azure function on the Azure portal.

Prerequisites

Before deploying Party Microservice on Azure, ensure you have the following:

  • Install the Azure Command Line Interface. For more information about the installation, click here.
  • Install Maven.
  • Install Mongo Shell.

    Download the Mongo Shell from Mongo Atlas under the tab named Connect with Mongo Shell by clicking Connect.

  • Get an active connection string of Mongo Atlas cluster. Acquire Mongo Atlas Cluster for Java driver version 3.4.
  1. Get MONGODB_CONNECT_STR string for Java driver version 3.4.
  2. Download the mongo shell from the Mongo Atlas under the Connect with mongo shell tab by clicking Connect.
  3. MONGOSHELL_CONNECT_STR string must be obtained under the Connect with MongoDB Compass by clicking Connect.

To deploy Party Microservice on Azure, follow these steps.

  1. Download and extract the generated zip file from the target folder into the installation directory.
  2. In Command Prompt, go to the installation directory.
  3. Modify the installation-specific details such as Resource Group, Location, and MONGODB_CONNECT_STR, MONGOSHELL_CONNECT_STR in the install.sh/install.bat script.

    For example,

    • SET MONGODB_CONNECT_STR="mongodb://Temenos:Temenos123@cluster0-shard-00-02.4o1ua.azure.mongodb.net:27017,cluster0-shard-00-00.4o1ua.azure.mongodb.net:27017,cluster0-shard-00-01.4o1ua.azure.mongodb.net:27017/ms_party?authSource=admin&gssapiServiceName=mongodb&replicaSet=atlas-vj913p-shard-0&ssl=true"
    • SET MONGOSHELL_CONNECT_STR="mongodb+srv://Temenos:Temenos123@cluster0.4o1ua.azure.mongodb.net"
  4. Insert default mongo.js file (master data) into the MongoDB through install.bat/install.sh file.

    To insert the data other than the master data, do the following:

    1. Load the prerequisite data into Mongo DB through the install-db-scripts.bat/.sh script file. Load the data only through the script files(.js).
    2. Place all the files under the folder path, ms-party-azure\target\azure-functions\<app folder.
    3. Send the following parameters while executing the bat file:
      url Provide the Mongo string URL along with the username and password that is given in the Prerequisite section.
      app_name Provide the app name given during the Azure deployment.
      scriptsProvide the file names delimited by comma.
    4. Run the following commands:
      • For .bat file,
        • install-db-scripts.bat --uri <uri> --app_name <app_name> --scripts "<filename1>,<filename2>"

          For example, install-db-scripts.bat --uri --mongodb+srv://test:test@cluster0.4o1ua.azure.mongodb.net --app_name partyapp --scripts "mongo1.js,mongo2.js".

      • For .sh file,
        • install-db-scripts.sh --uri <uri> --app_name <app_name> --scripts "<filename1>,<filename2>"

          For example, install-db-scripts.sh --uri mongodb+srv://test:test@cluster0.4o1ua.azure.mongodb.net --app_name partyapp --scripts mongo1.js,mongo2.js.

  5. By default, Azure function app name in the script can be changed. In case of Azure function app's name changes, rename the folder (ms-party-azure\target\azure-functions\<app folder>\) available in the app's name.
  6. To enable authorization and authentication, follow these steps:
    1. In addition to the API key, enable JWT Authentication in the installation scripts.
    2. To enable security policies and access rights to the APIs, perform the XACML configurations in the installation scripts.
  7. After this, execute either install.sh or install.bat.
    ScriptDescription
    install.sh/install.bat The script deploys the necessary components for a Microservice. It includes the deployment of the streaming services to run the Microservice independently.

    After successful installation, these Azure functions are created.

  8. Signin to the Azure portal and verify if the Resource Group and the Function App are created.

    Resource Group

    Function App

    Party Functions

  9. Obtain the API key for each endpoint by using the func azure functionapp list-functions <function-app-name> --show-keys command. Alternatively, you can also obtain the API key from the Azure function GUI.

  10. Obtain the endpoints of the Azure Function App from the Azure Function App. The URL of the sample function app is as follows:

    The Get Function URL provides the complete URL along with the API key.

  11. After the successful deployment, load the database, collections, and reference data(master data) into the mongo server database for the Party Microservice.

For PostgreSQL DB

Script Files and Folder Structure

  • Azure Script files:
    • install-postgresql.bat/install-postgresql.sh: This script deploys the Party Microservice in the Standalone mode.
    • destroy-postgresql.sh/destroy-postgresql.bat: This script undeploys the Microservice and delete the Azure services from the Azure environment.
  • Folder structure for the ms-party-package-azure-postgresql<release_number>.zip file is as follows.

    Pom-azure-deploy.xml file deploys the Azure function on the Azure portal.

Prerequisites

Before deploying Party Microservice on Azure ensure you have the following:

  • Install the Azure Command Line Interface. For more information about the installation, click here.
  • Install Maven.

To deploy Party Microservice on Azure, follow these steps.

  1. Download and extract the generated zip file from the target folder into the installation directory.
  2. In Command Prompt, go to the installation directory.
  3. The default initmsdb.sql file (Master Data) is inserted into the PostgreSQL.
  4. In case of Azure function app's name changes, rename the folder (ms-party-azure\target\azure-functions\<app folder>\) available in the app's name
  5. To enable authorization and authentication, follow these steps:
    1. In addition to the API key, enable JWT Authentication in the installation scripts.
    2. To enable security policies and access rights to the APIs, perform the XACML configurations in the installation scripts.
  6. After this, execute either install.sh or install.bat.
    ScriptDescription
    install-postgresql.sh / install-postgresql.bat This deploys the necessary components for a microservice, including streaming services, and runs the Microservice independentlyThe script deploys the necessary components for a microservice. It includes the deployment of the streaming services to run the Microservice independently.

    After successful installation, these Azure functions are created.

  7. Sign in to the Azure portal and verify if the Resource Group and the Function App are created.

    Resource Group

    Function App

    Party Functions

  8. Obtain the API key for each endpoint by using the func azure functionapp list-functions <function-app-name> --show-keys command. Alternatively, you can also obtain the API key from the Azure function GUI.

  9. Obtain the endpoints of the Azure Function App from the Azure Function App. The URL of the sample function app is as follows:

    The Get Function URL provides the complete URL along with the API key.

  10. After the successful deployment, load the database, collections, and reference data(master data) into the PostgreSQL DB server for the Party Microservice.

Field Name
|
Application/Table name

Temenos Headquarters SA
2 Rue de l'Ecole-de-Chimie
CH - 1205 Geneva
Switzerland

Copyright © 2020- Temenos Headquarters SA

Published on :
Tuesday, May 23, 2023 9:33:37 PM IST